package com.bjqh.edu.Bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/9/20.
 */

public class Course implements Parcelable {
    /**
     * total : 0
     * status : 200
     * rows : [{"total":null,"des":"适合小学一年级,一对一","status":null,"img":"/sys/course//1505721986348.png","discount":"7","rows":null,"id":12,"time":1505664000000,"price":0,"page":null,"typeid":1,"name":"免费试听课","grade":{"uid":null,"total":null,"id":6,"time":1505717112000,"flag":null,"contentid":"9,10,11,12,14,13","page":null,"name":"2年级","img":"/sys/menu/1505717111904.png","cname":null,"rows":null},"gradeid":6,"courseType":{"total":null,"id":1,"time":1505664000000,"flag":0,"page":null,"name":"试听课","img":"/sys/menu/1505705488491.png","rows":null}},{"total":null,"des":"适合小学二年级,一对一","status":null,"img":"/sys/course//1505724885634.png","discount":"8","rows":null,"id":13,"time":1505664000000,"price":999,"page":null,"typeid":1,"name":"免费试听","grade":{"uid":null,"total":null,"id":6,"time":1505717112000,"flag":null,"contentid":"9,10,11,12,14,13","page":null,"name":"2年级","img":"/sys/menu/1505717111904.png","cname":null,"rows":null},"gradeid":6,"courseType":{"total":null,"id":1,"time":1505664000000,"flag":0,"page":null,"name":"试听课","img":"/sys/menu/1505705488491.png","rows":null}},{"total":null,"des":"适合小学一年级,一对一","status":null,"img":"/sys/course//1505887357402.png","discount":"8","rows":null,"id":14,"time":1505664000000,"price":0,"page":null,"typeid":1,"name":"免费试听","grade":{"uid":null,"total":null,"id":6,"time":1505717112000,"flag":null,"contentid":"9,10,11,12,14,13","page":null,"name":"2年级","img":"/sys/menu/1505717111904.png","cname":null,"rows":null},"gradeid":6,"courseType":{"total":null,"id":1,"time":1505664000000,"flag":0,"page":null,"name":"试听课","img":"/sys/menu/1505705488491.png","rows":null}},{"total":null,"des":"适合小学一年级,一对一","status":null,"img":"/sys/course//1505875194388.png","discount":"8","rows":null,"id":17,"time":1505836800000,"price":0,"page":null,"typeid":1,"name":"免费试听","grade":{"uid":null,"total":null,"id":6,"time":1505717112000,"flag":null,"contentid":"9,10,11,12,14,13","page":null,"name":"2年级","img":"/sys/menu/1505717111904.png","cname":null,"rows":null},"gradeid":6,"courseType":{"total":null,"id":1,"time":1505664000000,"flag":0,"page":null,"name":"试听课","img":"/sys/menu/1505705488491.png","rows":null}}]
     */

    private int total;
    private int status;
    private List<RowsBean> rows;

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public List<RowsBean> getRows() {
        return rows;
    }

    public void setRows(List<RowsBean> rows) {
        this.rows = rows;
    }

    public static class RowsBean implements Parcelable {

        /**
         * total : null
         * des : 适合小学一年级,一对一
         * status : null
         * img : /sys/course//1505721986348.png
         * discount : 7
         * rows : null
         * id : 12
         * time : 1505664000000
         * price : 0.0
         * page : null
         * typeid : 1
         * name : 免费试听课
         * grade : {"uid":null,"total":null,"id":6,"time":1505717112000,"flag":null,"contentid":"9,10,11,12,14,13","page":null,"name":"2年级","img":"/sys/menu/1505717111904.png","cname":null,"rows":null}
         * gradeid : 6
         * courseType : {"total":null,"id":1,"time":1505664000000,"flag":0,"page":null,"name":"试听课","img":"/sys/menu/1505705488491.png","rows":null}
         */

        private String total;
        private String des;
        private String status;
        private String img;
        private String discount;
        private String rows;
        private String  id;
        private long time;
        private double price;
        private String page;
        private int typeid;
        private String name;
        private GradeBean grade;
        private int gradeid;

        public double getOrPrice() {
            return orPrice;
        }

        public void setOrPrice(double orPrice) {
            this.orPrice = orPrice;
        }

        private double orPrice;
        private CourseTypeBean courseType;

        public String getName2() {
            return name2;
        }

        public void setName2(String name2) {
            this.name2 = name2;
        }

        private String name2;
        public String getTotal() {
            return total;
        }

        public void setTotal(String total) {
            this.total = total;
        }

        public String getDes() {
            return des;
        }

        public void setDes(String des) {
            this.des = des;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getImg() {
            return img;
        }

        public void setImg(String img) {
            this.img = img;
        }

        public String getDiscount() {
            return discount;
        }

        public void setDiscount(String discount) {
            this.discount = discount;
        }

        public String getRows() {
            return rows;
        }

        public void setRows(String rows) {
            this.rows = rows;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public long getTime() {
            return time;
        }

        public void setTime(long time) {
            this.time = time;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public String getPage() {
            return page;
        }

        public void setPage(String page) {
            this.page = page;
        }

        public int getTypeid() {
            return typeid;
        }

        public void setTypeid(int typeid) {
            this.typeid = typeid;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public GradeBean getGrade() {
            return grade;
        }

        public void setGrade(GradeBean grade) {
            this.grade = grade;
        }

        public int getGradeid() {
            return gradeid;
        }

        public void setGradeid(int gradeid) {
            this.gradeid = gradeid;
        }

        public CourseTypeBean getCourseType() {
            return courseType;
        }

        public void setCourseType(CourseTypeBean courseType) {
            this.courseType = courseType;
        }

        public static class GradeBean implements Parcelable {

            /**
             * uid : null
             * total : null
             * id : 6
             * time : 1505717112000
             * flag : null
             * contentid : 9,10,11,12,14,13
             * page : null
             * name : 2年级
             * img : /sys/menu/1505717111904.png
             * cname : null
             * rows : null
             */

            private String uid;
            private String total;
            private int id;
            private long time;
            private String flag;
            private String contentid;
            private String page;
            private String name;
            private String img;
            private String cname;
            private String rows;

            public String getUid() {
                return uid;
            }

            public void setUid(String uid) {
                this.uid = uid;
            }

            public String getTotal() {
                return total;
            }

            public void setTotal(String total) {
                this.total = total;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public long getTime() {
                return time;
            }

            public void setTime(long time) {
                this.time = time;
            }

            public String getFlag() {
                return flag;
            }

            public void setFlag(String flag) {
                this.flag = flag;
            }

            public String getContentid() {
                return contentid;
            }

            public void setContentid(String contentid) {
                this.contentid = contentid;
            }

            public String getPage() {
                return page;
            }

            public void setPage(String page) {
                this.page = page;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getImg() {
                return img;
            }

            public void setImg(String img) {
                this.img = img;
            }

            public String getCname() {
                return cname;
            }

            public void setCname(String cname) {
                this.cname = cname;
            }

            public String getRows() {
                return rows;
            }

            public void setRows(String rows) {
                this.rows = rows;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.uid);
                dest.writeString(this.total);
                dest.writeInt(this.id);
                dest.writeLong(this.time);
                dest.writeString(this.flag);
                dest.writeString(this.contentid);
                dest.writeString(this.page);
                dest.writeString(this.name);
                dest.writeString(this.img);
                dest.writeString(this.cname);
                dest.writeString(this.rows);
            }

            public GradeBean() {
            }

            protected GradeBean(Parcel in) {
                this.uid = in.readString();
                this.total = in.readString();
                this.id = in.readInt();
                this.time = in.readLong();
                this.flag = in.readString();
                this.contentid = in.readString();
                this.page = in.readString();
                this.name = in.readString();
                this.img = in.readString();
                this.cname = in.readString();
                this.rows = in.readString();
            }

            public static final Creator<GradeBean> CREATOR = new Creator<GradeBean>() {
                @Override
                public GradeBean createFromParcel(Parcel source) {
                    return new GradeBean(source);
                }

                @Override
                public GradeBean[] newArray(int size) {
                    return new GradeBean[size];
                }
            };
        }

        public static class CourseTypeBean implements Parcelable {
            /**
             * total : null
             * id : 1
             * time : 1505664000000
             * flag : 0
             * page : null
             * name : 试听课
             * img : /sys/menu/1505705488491.png
             * rows : null
             */

            private String total;
            private int id;
            private long time;
            private int flag;
            private String page;
            private String name;
            private String img;
            private String rows;

            public String getTotal() {
                return total;
            }

            public void setTotal(String total) {
                this.total = total;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public long getTime() {
                return time;
            }

            public void setTime(long time) {
                this.time = time;
            }

            public int getFlag() {
                return flag;
            }

            public void setFlag(int flag) {
                this.flag = flag;
            }

            public String getPage() {
                return page;
            }

            public void setPage(String page) {
                this.page = page;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getImg() {
                return img;
            }

            public void setImg(String img) {
                this.img = img;
            }

            public String getRows() {
                return rows;
            }

            public void setRows(String rows) {
                this.rows = rows;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.total);
                dest.writeInt(this.id);
                dest.writeLong(this.time);
                dest.writeInt(this.flag);
                dest.writeString(this.page);
                dest.writeString(this.name);
                dest.writeString(this.img);
                dest.writeString(this.rows);
            }

            public CourseTypeBean() {
            }

            protected CourseTypeBean(Parcel in) {
                this.total = in.readString();
                this.id = in.readInt();
                this.time = in.readLong();
                this.flag = in.readInt();
                this.page = in.readString();
                this.name = in.readString();
                this.img = in.readString();
                this.rows = in.readString();
            }

            public static final Creator<CourseTypeBean> CREATOR = new Creator<CourseTypeBean>() {
                @Override
                public CourseTypeBean createFromParcel(Parcel source) {
                    return new CourseTypeBean(source);
                }

                @Override
                public CourseTypeBean[] newArray(int size) {
                    return new CourseTypeBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.total);
            dest.writeString(this.des);
            dest.writeString(this.status);
            dest.writeString(this.img);
            dest.writeString(this.discount);
            dest.writeString(this.rows);
            dest.writeString(this.id);
            dest.writeLong(this.time);
            dest.writeDouble(this.price);
            dest.writeDouble(this.orPrice);
            dest.writeString(this.page);
            dest.writeInt(this.typeid);
            dest.writeString(this.name);
            dest.writeParcelable(this.grade, flags);
            dest.writeInt(this.gradeid);
            dest.writeParcelable(this.courseType, flags);
        }

        public RowsBean() {
        }

        protected RowsBean(Parcel in) {
            this.total = in.readString();
            this.des = in.readString();
            this.status = in.readString();
            this.img = in.readString();
            this.discount = in.readString();
            this.rows = in.readString();
            this.id = in.readString();
            this.time = in.readLong();
            this.price = in.readDouble();
            this.page = in.readString();
            this.typeid = in.readInt();
            this.name = in.readString();
            this.grade = in.readParcelable(GradeBean.class.getClassLoader());
            this.gradeid = in.readInt();
            this.courseType = in.readParcelable(CourseTypeBean.class.getClassLoader());
        }

        public static final Creator<RowsBean> CREATOR = new Creator<RowsBean>() {
            @Override
            public RowsBean createFromParcel(Parcel source) {
                return new RowsBean(source);
            }

            @Override
            public RowsBean[] newArray(int size) {
                return new RowsBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.total);
        dest.writeInt(this.status);
        dest.writeList(this.rows);
    }

    public Course() {
    }

    protected Course(Parcel in) {
        this.total = in.readInt();
        this.status = in.readInt();
        this.rows = new ArrayList<RowsBean>();
        in.readList(this.rows, RowsBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<Course> CREATOR = new Parcelable.Creator<Course>() {
        @Override
        public Course createFromParcel(Parcel source) {
            return new Course(source);
        }

        @Override
        public Course[] newArray(int size) {
            return new Course[size];
        }
    };
}
